
Component({
  options: {
    styleIsolation: 'shared',
  },
  /**
   * 组件的属性列表
   */
  properties: {
    list:{
      type: Array,
      value: []
    }
  },

  /**
   * 组件的初始数据
   */
  data: {
    imageBaseURL: getApp().imageBaseURL,
    imageResizeParams: getApp().imageResizeParams,
  },

  /**
   * 组件的方法列表
   */
  methods: {
    likeHandle(e) {
      const { targetId } = e.currentTarget.dataset
      this.triggerEvent('likeCommentHandle', { targetId })
    },
    deleteHandle(e) {
      const { targetId } = e.currentTarget.dataset
      this.triggerEvent('deleteCommentHandle', { targetId })
    },
    commentHandle(e) {

      const { targetId, cid } = e.currentTarget.dataset
      this.triggerEvent('showCommentInput', { targetId, cid: cid || 0 })
    },
    navUserDetail(e) {
      console.log(e);
      const { id, userType } = e.currentTarget.dataset
      if(userType == 1) {
        wx.navigateTo({
          url: `/pages/project_publisher_detail/index?id=${id}`,
        })
      }else if(userType == 2) {
        wx.navigateTo({
          url: `/pages/judges_detail/index?id=${id}`,
        })
      }
    }
  }
})
